﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CNotebook.Inventory;

namespace NotebookS2.Configuration.Master_Files.Inventory
{
    public partial class M_ITEM_LIST : Form
    {
        public M_ITEM_LIST()
        {
            InitializeComponent();
        }

        public string ConnectionString { get; set; }

        public void PrintPreview()
        {
            gridControl1.ShowPrintPreview();
        }

        private void M_ITEM_LIST_Load(object sender, EventArgs e)
        {
            ItemManager oManager = new ItemManager();

            oManager.ConnectionString = this.ConnectionString;
            oManager.Open();

            DataTable dt = oManager.GetItemMasterList(cboItemGroup.Text);

            oManager.Close();


            gridControl1.DataSource = dt;
            gridControl1.Refresh();
        }

        private void splitContainer1_Panel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void cboItemGroup_SelectedIndexChanged(object sender, EventArgs e)
        {
            ItemManager oManager = new ItemManager();

            oManager.ConnectionString = this.ConnectionString;
            oManager.Open();

            DataTable dt = oManager.GetItemMasterList(cboItemGroup.Text);

            oManager.Close();


            gridControl1.DataSource = dt;
            gridControl1.Refresh();
        }
    }
}
